const server_url="http://localhost:8080/ebuy_23rj2/";
axios = axios.create({
    baseURL: server_url+'/api',//设置基本的请求路径，这样在实例中就不比在写
});
//拦截器
axios.interceptors.response.use(
    function (response){//http状态码200
        const data=response.data;
        if (data.code==401) {
            alert(data.msg);
            parent.location.href="login.html";
        }
        return response;
    }
)